
from django.db import models
import django.utils.timezone as timezone
# Create your models here.
class BaseModel(models.Model):
    create_time = models.DateTimeField('创建时间', default=timezone.now)
    update_time = models.DateTimeField('修改跟新时间', default=timezone.now)
    class Meta:
        abstract = True


class User(BaseModel):
    Status_Choice = ((0, '未激活'), (1, '激活'))
    username = models.CharField(max_length=120, null=True)
    password = models.CharField(max_length=255, null=True)
    #手机号时区
    area = models.CharField(max_length=50,default="+86")
    phone = models.BigIntegerField(null=True)
    email = models.CharField(max_length=255, null=True)
    address = models.CharField(max_length=255, null=True)
    status = models.IntegerField(default=0, choices=Status_Choice)
    #用户昵称
    nickname = models.CharField(max_length=120,null=True)
    img = models.CharField(max_length=200,null=True)
    is_delete = models.IntegerField(default=0)
#时区表
class Area(BaseModel):
    name = models.CharField(max_length=50)
    status = models.IntegerField(default=0) #灰度状态

# 三方绑定表
class Third(BaseModel):
    Status_Choice = ((0, '未绑定'), (1,'绑定'))
    phone = models.IntegerField(null=True)
    third_id = models.CharField(max_length=120, null=True)#'第三方生成的唯一标识'
    third_name = models.CharField(max_length=255, null=True)#'绑定的是那个第三方'
    status = models.IntegerField(default=0, choices=Status_Choice)


